<div class="fsh-pop">
    <div id="add_form" class="layui-form" lay-filter="add_form">
        <div class="layui-form-item">
            <label class="layui-form-label"><i>*</i>题</label>
            <div class="layui-input-block">
                <input type="text" name="title" lay-verify="required"  placeholder="请输入关键字" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><i>*</i>类型</label>
            <div class="layui-input-block">
               <select name="type">
                   <option value="1">单选</option>
                   <option value="2">多选</option>
                   <option value="3">判断</option>
               </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><i>*</i>答案</label>
            <div class="layui-input-block">
                <input type="text" name="answer" lay-verify="required"  placeholder="请输入关键字"
                       class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">内容</label>
            <div class="layui-input-block">
                <textarea id="q_content" name="content" style="width:500px;height:500px;"></textarea>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    layui.use(['form','layedit'], function () {
        var layedit = layui.layedit;
        // var index = layedit.build('q_content',{
        //     tool: ['strong' //加粗
        //         ,'italic' //斜体
        //         ,'underline' //下划线
        //         ,'del' //删除线
        //         ,'|' //分割线
        //         ,'left' //左对齐
        //         ,'center' //居中对齐
        //         ,'right' //右对齐
        //         ,'link' //超链接
        //         ,'unlink' //清除链接
        //         ,'face' //表情
        //     ]});
        var originData = JSON.parse($('<div>').html('<%=$data%>').text());
        console.log(originData);
        if(originData && originData.question_id){
            layui.form.val('add_form', originData);
        }
    });
</script>
<style>
    #upload_header {
        width: 100px;
        height: 100px;
    }
</style>